<template>
	<view class="u-demo-block">
		<!-- 轮播图 -->
		<u-swiper
				:list="list3"
				previousMargin="30"
				nextMargin="30"
				circular
				:autoplay="true"
				radius="5"
				bgColor="#ffffff"
				:duration='1'
				:circular='true'
				duration='500'
		></u-swiper>
		
		<!-- 九宫格日常服务 -->
		<u-divider :hairline="true"></u-divider>
		<uni-section title="日常服务" type="line">
		</uni-section>
		<!-- <u--text text="日常服务"></u--text> -->
		<u-divider :hairline="true"></u-divider>
		<u-grid
			:border="false">
				<u-grid-item
						v-for="(listItem,listIndex) in everydayList"
						:key="listIndex"
						@click="everydayClick(listItem.key)">
					<u-icon
						:customStyle="{paddingTop:20+'rpx'}"
						:name="listItem.name"
						:size="22">
					</u-icon>
					<text class="grid-text">{{listItem.title}}</text>
				</u-grid-item>
		</u-grid>
		<u-toast ref="uToast" />
		
		<!-- 九宫格实训服务 -->
		<u-divider :hairline="true"></u-divider>
		<uni-section title="实训服务" type="line">
		</uni-section>
		<!-- <u--text text="实训服务"></u--text> -->
		<u-divider :hairline="true"></u-divider>
		<u-grid
			:border="false">
				<u-grid-item
						v-for="(listItem,listIndex) in practicalTrainingList"
						:key="listIndex"
						@click="practicalTrainingClick(listItem.key)">
					<u-icon
						:customStyle="{paddingTop:20+'rpx'}"
						:name="listItem.name"
						:size="22">
					</u-icon>
					<text class="grid-text">{{listItem.title}}</text>
				</u-grid-item>
		</u-grid>
		<u-toast ref="uToast" />
		
		<!-- 九宫格实训服务 -->
		<u-divider :hairline="true"></u-divider>
		<uni-section title="就业服务" type="line">
		</uni-section>
		<!-- <u--text text="就业服务"></u--text> -->
		<u-divider :hairline="true"></u-divider>
		<u-grid
			:border="false">
				<u-grid-item
					v-for="(listItem,listIndex) in employmentList"
					:key="listIndex"
					@click="employmentClick(listItem.key)">
					<u-icon 
						:customStyle="{paddingTop:20+'rpx'}"
						:size="22" 
						:name="listItem.name">
					</u-icon>
					<text class="grid-text">{{listItem.title}}</text>
				</u-grid-item>
		</u-grid>
		<u-toast ref="uToast" />
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				cardImage1:"../../../static/icon/xinxi.png",
				cardImage2:"../../../static/icon/caogaoxiang.png",
				cardImage3:"../../../static/icon/moban.png",
				list3: [
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				],
				/* 日常服务 */
				everydayList: [
					{
						name: '../../../static/icon/xinxi.png',
						title: '日报',
						key : "pages/service/###",
					},
					{
						name: '../../../static/icon/xinxi.png',
						title: '周报',
						key : "pages/service/###",
					},
					{
						name: '../../../static/icon/piliang.png',
						title: '申诉',
						key : "pages/service/###",
					},
					{
						name: '../../../static/icon/tuichu.png',
						title: '请假',
						key : "pages/service/###",
					},
					{
						name: '../../../static/icon/banji.png',
						title: '班级',
						key : "pages/service/###",
					},
					{
						name: '../../../static/icon/shipin.png',
						title: '课程',
						key : "pages/service/###",
					},
				],
				/* 实训服务 */
				practicalTrainingList: [
					{
						name: '../../../static/icon/shouquan.png',
						title: '模拟面试',
						key : "/pages/service/practicaltrainingservice/mockinterview/mockinterview",
					},
					{
						name: '../../../static/icon/paizhao.png',
						title: '简历',
						key : "/pages/service/practicaltrainingservice/resume/resume",
					},
					{
						name: '../../../static/icon/liebiao.png',
						title: '题库',
						key : "pages/service/###",
					}
				], 
				/* 就业服务 */
				employmentList: [
					{
						name: 'calendar',
						title: '面试预约',
						stuId:'',
						key : "/pages/service/employmentservice/employmenInterview/employmenInterview?interviewStuName=",
					},
					{
						name: 'order',
						title: '面试反馈',
						key : "/pages/service/###",
					},
					{
						name: 'star',
						title: '就业信息',
						key : "/pages/service/employmentservice/employmenInformation/employmenInformation?stuId=",
					},
					{
						name: 'tags',
						title: '就业维护',
						key : "/pages/service/employmentservice/employmenMaintain/employmenMaintain?stuId=",
					},
					{
						name: 'grid',
						title: '资源反馈',
						key : "/pages/service/###",
					},
					{
						name: 'more-dot-fill',
						title: '更多',
						key : "/pages/service/###",
					}
				]
			};
		},
		created(){
			if(JSON.stringify(uni.getStorageSync('stu'))!="{}"){
				this.stuInfo=uni.getStorageSync('stu')
				this.employmentList[0].stuId=this.stuInfo.stuId;
				this.employmentList[0].key+=this.employmentList[0].stuId;//面试预约
				this.employmentList[2].key+=this.employmentList[0].stuId;//就业信息
				this.employmentList[3].key+=this.employmentList[0].stuId;//就业维护
			}
		},
			
		methods: {
			everydayClick(key){
				uni.navigateTo({
					url: key
				});
			},
			practicalTrainingClick(key){
				uni.navigateTo({
					url: key
				});
			},
			employmentClick(key){
				uni.navigateTo({
					url: key
				});
			}
		}
	}
</script>

<style lang="scss">
	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		box-sizing: border-box;
	}
</style>
